package org.allen.test;

import lombok.Data;
import org.allen.annotation.FieldAutowired;

/**
 * @Author: Allen
 * @Date: Created in 17:29 2019-09-26
 * @Description:
 */
@Data
public class Order {

    private String orderId;

    private String userCode;

    @FieldAutowired(thisFieldForParam = "userCode" ,targetClass = UserService.class ,targetMethod = "getByCode" ,targetField = "userName")
    private String userName;

    public Order(String orderId, String userCode) {
        this.orderId = orderId;
        this.userCode = userCode;
    }

    public Order() {
    }

    @Override
    public String toString() {
        return "Order{" +
                "orderId='" + orderId + '\'' +
                ", userCode='" + userCode + '\'' +
                ", userName='" + userName + '\'' +
                '}';
    }
}
